// import Vue from 'vue'
// import VueRouter from 'vue-router'
import index from '../views/index.vue'
import manage from '../views/manage.vue'

//! 路由懒加载，show为组件名称，import的参数1为路由的分组，用一个分组同时加载，参数2为引入这里组件
// import show from '../views/show.vue'
// import tabTwo from '../views/tabTwo.vue'
const show = () => import(/* webpackChunkName: "tabs" */ '../views/show.vue')
const tabTwo = () => import(/* webpackChunkName: "tabs" */ '../views/tabTwo.vue')

// import manage2 from '../views/manage2.vue'
const manage2 = () => import(/* webpackChunkName: "manage2" */ '../views/manage2.vue')


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: index,
    redirect:"show",
    children: [
      {
        path: 'show',
        name: 'show',
        component: show
      },
      {
        path: 'tabTwo',
        name: 'tabTwo',
        component: tabTwo
      }
    ]
  },
  {
    path: '/manage/:id',
    name: 'manage',
    component: manage
  },
  {
    path: 'manage2',
    name: 'manage2',
    component: manage2
  }

]

const router = new VueRouter({
  routes
})

export default router
